package com.changzhi.controller;

import com.changzhi.common.annotation.Verify;
import com.changzhi.common.util.Result;
import com.changzhi.ldyl.model.dto.BaseDto;
import com.changzhi.ldyl.model.dto.CommonDto;
import com.changzhi.service.SignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description:星座物语
 * @author: 小落
 * @date: 2021年02月25日
 */
@Slf4j
@CrossOrigin
@RestController
@RequestMapping("sign")
public class SignController {

	@Autowired
	private SignService signService;

	@Verify(timestamp = false)
	@PostMapping("rankings")
	public Result rankings(@RequestBody CommonDto commonDto){
		return Result.success(signService.rankings(commonDto.getUserId(), commonDto.getType()));
	}

	@Verify(timestamp = false)
	@PostMapping("task")
	public Result task(@RequestBody BaseDto baseDto){
		return Result.success(signService.task(baseDto.getUserId()));
	}

	@PostMapping("starShow")
	public Result starShow(@RequestBody BaseDto baseDto){
		return Result.success(signService.starShow());
	}
}
